<template>
	<view>
		<view>
			<text>{{nowTime}}</text>
			<text>{{resolutionTime}}</text></br>
			<text>{{resolutionTime2}}</text>
		</view>
	</view>
</template>

<script>
	import dateUtils from '../../utils/date/dateUtils.js'
	export default {
		data() {
			return {
				nowTime: '',
				resolutionTime:'',
				resolutionTime2:'',
			}
		},
		onLoad() { //数据还是要加this，才能表示是当前页面需要的
			var nowDate = new Date();
			this.nowTime = this.nowTime + nowDate + "\n";
			this.nowTime = this.nowTime + nowDate.getYear()+"年"+nowDate.getMonth()+"月"+nowDate.getDay()+"天"
			+nowDate.getHours()+"时"
			 +nowDate.getMinutes()+"分"
			 +nowDate.getMilliseconds()+"秒"+ "\n";
			this.nowTime = this.nowTime + nowDate.getFullYear()+"年/"+ nowDate.getUTCFullYear()+"年_"
			+ nowDate.getUTCMonth()+"月"
			+ nowDate.getUTCDay()+"日"
			+ nowDate.getUTCHours()+"时"
			+ nowDate.getUTCMinutes()+"分"
			+ nowDate.getSeconds()+"秒"+"\n";
			this.nowTime = this.nowTime +"时间戳："+ nowDate.getTime() + "\n";
			this.nowTime = this.nowTime +"格式化："+ dateUtils.timestampToTime(nowDate.getTime()) + "\n";
			
			//UNITS定义的单位在内部未找到，是个很麻烦的问题。
			this.nowTime = this.nowTime +"距离现在："+ dateUtils.UNITS('秒') + "\n";
			this.nowTime = this.nowTime +"距离现在："+ dateUtils.humanize(120000 ) + "\n";
			// 20210607    123335
			this.resolutionTime= dateUtils.timestampToTime(dateUtils.parseTimeByType("20210607123335",dateUtils.dateConstant.dateYMDHMS).getTime());
			this.resolutionTime2= dateUtils.parseTimeStrByType("20210607123335",dateUtils.dateConstant.dateYMDHMS,dateUtils.dateConstant.dateYMD_HMS) ;
		},
		onReady() {
			// this.nowTime=dateUtils.formatDate(new Date().getMilliseconds());
			// nowTime=dateUtils.dateUtils.humanize(new Date().getMilliseconds());
			// nowTime=dateUtils.humanize(new Date().getMilliseconds());
		},
		methods: {

		}
	}
</script>

<style>

</style>
